<template>
    <div class="courses-erji-nav">
        <el-menu :default-active="activeIndex" class="el-menu-demo"  mode="horizontal" :router="true">
            <el-menu-item index="/Teaching/MyCourses/Management/ManageClass/ManageList" style="background:transparent" >班级管理</el-menu-item>
            <el-menu-item index="/Teaching/MyCourses/Management/Virtual/Manage" style="background:transparent">虚机管理</el-menu-item>
            <!-- <el-menu-item index="/Teaching/MyCourses/Management/AssistantManage" style="background:transparent">助教管理</el-menu-item> -->
            <el-menu-item index="/Teaching/MyCourses/Management/AssistantManage/Assisge" style="background:transparent" :disabled="darkFlag ">
                <el-tooltip v-if="darkFlag" class="item" effect="dark" content="演示版本暂不提供助教功能" placement="bottom">
                    <i class="iconfont icon-biyan"></i>
                </el-tooltip>助教管理
            </el-menu-item>
            
        </el-menu>
    </div>
</template>

<script>
    export default {
        data () {
            return {
                activeIndex: '',
                //助教是否置灰标识
                darkFlag:false,
            }
        },
        created() {
            let self = this
            self.fetchDate()
            self.AssintShow()
        },
        methods: {
            fetchDate() {
                let self = this
                var cur_path = self.$route.meta.navActive; //获取当前路由
                self.activeIndex = cur_path
            },
            //新增需求 将助教功能变成动态值
            AssintShow(){
                let self = this
                self.$http.get('/tes/unauthorized/internet').then(response => {
                    let res = response.data
                    if(res.code == '200'){
                       self.darkFlag = res.data
                    }else{
                        self.$message.error(res.message)
                    }
                }).catch(err => {
                    console.log(err)
                })
            }
        },
        watch: {
            "$route": "fetchDate"
		}
    }
</script>
<style lang="scss" scoped>
    .courses-erji-nav{
        .el-menu-demo{
            .el-menu-item{
                i{
                    vertical-align: sub;
                    margin-right: 10px;
                }
                &:hover{
                    background: transparent;
                     color:#1277eb;
                }
            }
            .is-disabled{
                &:hover{
                     color:#474747
                }
            }
        }
    }
</style>
